<template>
  <div>
    <van-field
      v-model="value"
      is-link
      readonly
      label="第一位儿童"
      :placeholder="result"
      @click="showPicker = true"
    />
    <van-popup v-model:show="showPicker" round position="bottom">
      <van-picker
        :columns="columns"
        @cancel="showPicker = false"
        @confirm="onConfirm"
      />
    </van-popup>
  </div>
</template>

<script>
export default{
    data(){
        return{
            //年龄段
            columns:["不满1岁","1岁","2岁","3岁","4岁","5岁","6岁","7岁","8岁","9岁","10岁","11岁","12岁","13岁","14岁","15岁","16岁","17岁"],
            //年龄选择结果
            result:"",
            //
            showPicker:false,
        }
    },
    methods:{
        //年龄段的
        onConfirm(value){
            this.result = value;
            this.showPicker = false;
        }
    }
}
</script>